package com.misty.bridge_pattern.client;

public class Client {
    /**
     * ● 增加公司，要么继承Corp类，要么继承HouseCorp或ShanZhaiCorp，不用再修改原有的类了。
     * <p>
     * ● 增加产品，继承Product类，或者继承House类，你要把房子分为公寓房、别墅、商业用房等。
     *
     * @param args
     */
    public static void main(String[] args) {
        Product house = new House();
        Corp houseCorp = new HouseCorp(house);
        houseCorp.makeMoney();

        Product iPod = new IPod();
        Corp shanzaiCorp = new ShanzaiCorp(iPod);
        shanzaiCorp.makeMoney();

        //扩展一下产品类，生产服装;
        Product clothes = new Clothes();
        shanzaiCorp = new ShanzaiCorp(clothes);
        shanzaiCorp.makeMoney();

    }
}
